<!-- BEGIN:main -->
<script type="text/javascript">
    function client_check_register(){
        document.getElementById('password1').value = MD5(document.getElementById('password1_tpl').value);
        document.getElementById('password2').value = MD5(document.getElementById('password2_tpl').value);
        username = document.getElementById('username').value;
        

        password = document.getElementById('password1').value;
        password2= document.getElementById('password2').value;
        if (password=="" || username==""){
            alert("Please enter the username and the password!");
            document.getElementById('username').focus();
            return false;
        }

        if (password!=password2){
            alert("Password does not match!");
            document.getElementById('password1_tpl').focus();
            return false;
        };
        return true;
    }
</script>


<div id="page_title">
    <h2>Edit {USERNAME} infomations</h2>
</div>
{MSG}
<form action="" method="POST" onsubmit="return client_check_register()">
    <table class="panel" id="form">
        <tr>
            <td><label for="username">Username:</label></td>
            <td width="70%"><input type="text" name="username" id="username" maxlength="30" size="40" value="{USERNAME}"/></td>
        </tr>
        <tr>
            <td><label for="displayname">Displayname:</label></td>
            <td width="70%"><input type="text" name="displayname" id="displayname"  maxlength="50" size="40" value="{DISPLAYNAME}"/></td>
        </tr>
        <tr>
            <td><label for="password1_tpl">Password:</label></td>
            <td><input type="password" name="password1_tpl" id="password1_tpl" maxlength="50" size="40" value=""/>
                <div class="smalltext">Set blank if you don't want to change!</div>
                <input type="hidden" name="password1" id="password1">
            </td>
        </tr>
        <tr>
            <td><label for="Retype password">Password again:</label></td>
            <td><input type="password" name="password2_tpl" id="password2_tpl" maxlength="50" size="40" value=""/><br>
                <input type="hidden" name="password2" id="password2">
            </td>
         </tr>
         <tr>
            <td><label for="group">Group:</label></td>
            <td width="70%">
            {GROUPBOX}
            </td>
        </tr>
        {EXT}
        <script type="text/javascript">
            

            $(document).ready(function(){
            $("#groupbox").ready(function(){
                $(".ext_adviser_info").hide();
                $(".ext_stdent_info").hide();
                drop_box_change();
                });
            });
            $(document).ready(function(){
             $("#groupbox").change(function(){
                    drop_box_change();
              });
            });
        </script>

         <tr>
             <td></td>

             <td>
             <a href="{DELETE_LINK}">
                     <input  style="color: red; float: right; margin:10px 5px;" class="button" type="button" name="delete" value="Delete" onclick="return confirm('Are you want to delete this user?')"/>
             </a>
             
                     <input style="float: right; margin:10px 5px;" type="submit" class="button" name="submit" id="submit" value="Save" />
             </td>
        </tr>
    </table>
</form>


<!-- END:main -->

<!-- BEGIN:sinhvien -->
<!--        <tr>
            <td>Điểm học tập:</td>
            <td width="70%"><input type="text" name="diemhoctap" id="diemhoctap" maxlength="50" size="40" value="{HOCTAP}"/></td>
        </tr>
        <tr>
            <td>Điểm rèn luyện:</td>
            <td width="70%"><input type="text" name="diemrenluyen" id="diemrenluyen" maxlength="50" size="40" value="{RENLUYEN}"/></td>
        </tr>-->
        <tr>
            <td>Thông tin sinh viên:</td>
            <td width="70%"><textarea  name="student_info" id="student_info" maxlength="1000" />{SINHVIEN_INFO}</textarea></td>
        </tr>
<!-- END:sinhvien-->

<!-- BEGIN:giaovien -->
        <tr>
            <td>Thông tin giảng viên:</td>
            <td width="70%"><textarea  name="adviser_info" id="adviser_info" maxlength="1000" />{GIAOVIEN_INFO}</textarea></td>
        </tr>
<!-- END:giaovien-->

<!-- BEGIN:admin -->
        <tr class="ext_stdent_info" >
            <td>Điểm học tập:</td>
            <td width="70%"><input type="text" name="diemhoctap" id="diemhoctap" maxlength="50" size="40" value="{HOCTAP}"/></td>
        </tr>
        <tr class="ext_stdent_info" >
            <td>Điểm rèn luyện:</td>
            <td width="70%"><input type="text" name="diemrenluyen" id="diemrenluyen" maxlength="50" size="40" value="{RENLUYEN}"/></td>
        </tr>
        <tr class="ext_stdent_info" >
            <td>Thông tin sinh viên:</td>
            <td width="70%"><textarea  name="student_info" id="student_info" maxlength="1000" />{SINHVIEN_INFO}</textarea></td>
        </tr>
        <tr class="ext_adviser_info" >
            <td>Thông tin giảng viên:</td>
            <td width="70%"><textarea  name="adviser_info" id="adviser_info" maxlength="1000" />{GIAOVIEN_INFO}</textarea></td>
        </tr>
<!-- END:admin-->

<!-- BEGIN:success_msg -->
<div id="msg" style="text-align:center;">User have been modified!</div>
<div class="toolbar" style="text-align:center;">{TOOLBAR_LINKS}</div>
<!-- END:success_msg -->


